package com.com.typhoon.dao;

import com.com.typhoon.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import java.util.List;


/**
 * @author shuya | dongfeng.zdf@alibaba-inc.com
 * @description
 * @date 2018/10/11 下午4:55
 * @description
 * @modified by
 * @since V2.0.0
 */
@Repository
public class User2Dao {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public List<User> findAll() {
        return this.jdbcTemplate.query("select * from User", BeanPropertyRowMapper.newInstance(User.class));
    }

}
